# Maintainer: Jan Alexander Steffens (heftig) <heftig@archlinux.org>

pkgname=gpaste
pkgver=3.40.2
pkgrel=1
pkgdesc="Clipboard management system"
url="https://www.imagination-land.org/tags/GPaste.html"
license=(BSD)
arch=(x86_64)
depends=(gtk3)
makedepends=(vala appstream-glib gobject-introspection gnome-shell
             gnome-control-center git meson)
optdepends=("wgetpaste: Upload clipboard contents")
_commit=4ac82dc066b5b3f704793e285f663e607d0f21ad  # tags/v3.40.2^0
source=("git+https://github.com/keruspe/gpaste#commit=$_commit")
sha256sums=('SKIP')

pkgver() {
  cd $pkgname
  git describe --tags | sed 's/^v//;s/-/+/g'
}

prepare() {
  cd $pkgname
}

build() {
  arch-meson $pkgname build
  meson compile -C build
}

check() {
  meson test -C build --print-errorlogs
}

package() {
  DESTDIR="$pkgdir" meson install -C build
  install -Dt "$pkgdir/usr/share/licenses/$pkgname" -m644 $pkgname/COPYING
}
